import jwt  # 导包

encode_jwt = jwt.encode({'uid': '14'}, '123', algorithm='HS256')  # 经行编码

print(encode_jwt)

# 解码
encode_str = str(encode_jwt, 'utf-8')

decode_jwt = jwt.decode(encode_str, '123', algorithms=['HS256'])
print(decode_jwt)
